package com.sq.ai.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sq.ai.pojo.AlgorNode;
import com.sq.ai.service.AlgorNodeService;
import com.sq.ai.mapper.AlgorNodeMapper;
import com.sq.ai.vo.SysAlgorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 *
 */
@Service
public class AlgorNodeServiceImpl extends ServiceImpl<AlgorNodeMapper, AlgorNode>
    implements AlgorNodeService{

    @Autowired
    private AlgorNodeMapper algorNodeMapper;

    @Override
    public List<AlgorNode> selectByWhere(AlgorNode sysAlgor) {
        List<AlgorNode> list = algorNodeMapper.selectByWhere(sysAlgor);
        if (Objects.isNull(list) || list.isEmpty()){
            return new ArrayList<>();
        }
        return list;
    }

    @Override
    public List<SysAlgorVo> getAlgorLabel() {
        return algorNodeMapper.getAlgorLabel();
//        return null;
    }
}




